import {NextRequest, NextResponse} from "next/server";
import {getStudentById} from "@/lib/student";

export async function GET(req: NextRequest) {
    let id = req.nextUrl.pathname.slice(
        req.nextUrl.pathname.lastIndexOf("/") + 1,
        req.nextUrl.pathname.length
    )

    const student = await getStudentById(id)

    return NextResponse.json({student})
}